﻿namespace CSharp_2022
{
    internal class Program
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {   //隐式转换
            Console.WriteLine("同学" + 2 + 3);
            Console.WriteLine($"同学{2}{3}");
            //强制转换
            int myInt = (int)3.0;
            Console.WriteLine(myInt);
            //Convert
            int myInt2 = Convert.ToInt32(myInt / 2.0);
            Console.WriteLine(myInt2); Console.WriteLine(myInt);
            //Parse
            int myInt3 = int.Parse("3");
            Console.Write(myInt3);
            //TryParse
            Console.Write("请输入你的分数");
            string input = Console.ReadLine();
            int myScore;
            bool resultForTransfer = int.TryParse(input, out myScore);
            if (resultForTransfer)
                Console.WriteLine("Thanks");
            else
                Console.WriteLine("Error");
            //数组 不可变维
            int[] myInts = new int[10] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

            var lst = new List<string>();
            for (int i = 0; i < 10; i++)
            {
                //lst.Add(i.ToString());
                myInts[i] = i;
            }
            
        }
    }
}